extends Control

@onready var time_value = $VBoxContainer/GridContainer/TimeValue
@onready var death_value = $VBoxContainer/GridContainer/DeathValue
@onready var coins_value = $VBoxContainer/GridContainer/CoinsValue

func _ready():
	var duration = Global.get_complete_time()
	if duration > 86400:
		time_value.set_text("超24小时")
	else:
		var minute = duration / 60
		var second = duration % 60
		var t = "%d:%02d" % [minute, second]
		time_value.set_text(t)
		
	death_value.set_text(str(Global.get_death_total()))
	coins_value.set_text(str(Global.get_coins()))
	
func _input(event):
	if event.is_action_pressed("ui_accept"):
		Global.back_to_title()
